#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

#if 0
int main()
{
	int a[3][2] = { (0, 1), (2, 3), (4, 5) };
	int *p = a[0];
	printf("%d", p[0]);
	return 0;
}

int main()
{
	int a[5] = { 1, 2, 3, 4, 5 };
	int *p = (int*)(&a + 1);
	printf("%d,%d", *(a + 1), *(p - 1));
	return 0;
}

int b[100];
int main()
{
	int a[100];
	cout << sizeof(&a[0]) << endl;
	return 0;
}

static int j;
int k = 0;
void func1(void)
{
	static int i = 0;
	i++;
}
void func2(void)
{
	j = 10;
	j++;
}
int main()
{
	for (k = 0; k < 10; k++)
	{
		func1();
		func2();
	}
	return 0;
}

int main()
{
	signed char a[1000];
	int i;
	for (i = 0; i < 1000; i++)
	{
		a[i] = -1 - i;
	}
	printf("%d", strlen(a));
	return 0;
}

int main()
{
	int a[5] = { 1, 2, 3, 4, 5 };
	int *p = (int*)(&a + 1);
	int *t = (int*)((int)a + 1);
	printf("%x,%x", p[-1], *t);
	return 0;
}

void fun(char a[10])
{
	char c = a[3];
}
int main()
{
	char b[10] = "abcdefg";
	fun(b[10]);
	return 0;
}

void func(int i)
{
	if (i > 0)
	{
		func(i / 2);
	}
	printf("%d\n", i);
}
int main()
{
	func(10);
	return 0;
}

int main()
{
	char a;
	a = getchar();
	if (EOF == a)
	{

	}
	return 0;
}

struct a{
	char b;
	short c;
	char d;
	int e;
};
struct b{
	char a;
	char d;
	short c;
	int e;
};
int main()
{
	cout << sizeof(a) << endl;
	cout << sizeof(b) << endl;
	return 0;
}

void fun(void)
{
	char string[10], str1[10];
	for (int i = 0; i < 10; i++)
	{
		str1[i] = 'a';
	}
	strcpy(string, str1);
	printf("%s", string);
}
int main()
{
	fun();
	return 0;
}

void func(void)
{
	unsigned int a = 6;
	int b = -10;
	(a + b > 6) ? puts(">6") : puts("<=6");
}
int main()
{
	func();
	return 0;
}

struct student
{
	char *name;
	int score;
}stu,*pstu;
int main()
{
	pstu = (struct student*)malloc(sizeof(struct student));
	strcpy(pstu->name, "jimy");
	pstu->score = 99;
	free(pstu);
	return 0;
}
#endif

